<extend name="common/common" />

<block name="title"><title>仟途旅游—路线</title></block>

<block name='css'>

</block>

<block name="content">
    <div class="section-preview" id="content" >
        <div class="container">
            <div class="row" >

            </div>
        </div>
        <div class="container" align="center" style="display: block;">
            <ul class="pagination" id="pagination">
                <!-- Pages-->
            </ul>
        </div>
    </div>


    <div id="temp" style="display: none">
        <div  class="col-lg-4 col-sm-6" >
            <div class="preview">
                <div class="image">
                    <a href="#" rel="nofollow" >
                        <img  style="width: 100%;height: 230px" src="__PUBLIC__/uploads/routeImage/14447573383311444757338_0.part" class="img-responsive" alt="">
                    </a>
                </div>
                <div class="options">
                    <h3 style="font-size: 18px;color: #329df0;"></h3>
                    <p>OnFoot</p>
                    <div class="btn-group">
                        <a href="#" class="btn btn-info">查看详情</a>
                    </div>
                </div>
            </div>
        </div>

    </div>


</block>

<block name="js">
    <script src="__PUBLIC__/js/laypage/laypage.js"></script>
    <script src="laypage/laypage.js"></script>

    <script>

        fixFooter();

        var fetchData = function(furl){
            if(furl==null){
                url = "{:U('Route/getRouteList')}";
            }else{
                url = furl;
            }

            $.ajax({
                url:url,
                type:'GET',
                dataType:'json',
                data:{
                }, success:function(json){
                    if(json.state!='1'){
                        alert("出错了");
                        return;
                    }

                    var show = json.show;
                    if(show == "" || show.total == 0){
                        $('.row').html('<p align="center">没有找到记录!!</p>');
                        $('.pagination').html("");

                        return;
                    }else{
                        //列表渲染
                        var list = json.data;
                        var $template_list_tbody = $('#temp');
                        var template_render = '';

                        for(var i in list){

                            $('#temp img').attr('src','__PUBLIC__/uploads/routeImage/'+list[i].img_url);
                            $('#temp h3').html(list[i].name);
                            $('#temp p').text(list[i].company);
                            $('#temp a').attr('href','{:U(\'Route/readRoute\')}?id='+list[i].id);
                            template_render += $template_list_tbody.html();
                        }

                        $('.row').html(template_render);
                    }
                    make_page(json.show,'.pagination','?');
                    $('html,body').animate({'scrollTop':0},300);
                }
            })
        }

        fetchData();

        $('.ro').addClass('active1');
        $('.hp').removeClass('active1');
        $('html,body').animate({'scrollTop':0},300);
    </script>
</block>

